package com.wuliu.common.constant;

/**
 * 统一返回状态码
 *
 * @author realue
 * @version 1.0
 * @date 2022-10-21 9:14
 */
public enum ResultCode {
    /* 通用状态码 成功与失败 */
    SUCCESS(200, "操作成功"),
    FAILED(201, "操作失败"),
    SYSTEM_ERROR(500, "系统错误"),

    BAD_PARAMETER(400, "请求参数错误"),
    BAD_METHOD(401, "请求方式错误"),

    UNSUPPORTED_TYPE(415, "不支持的数据类型"),
    //.......更多
    ;
    private final Integer code;
    private final String msg;


    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
